package com.example.shop_2304.adapter

import android.widget.RatingBar
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shop_2304.R
import com.example.shop_2304.room.Pinglun

class PlAdapter:BaseQuickAdapter<Pinglun,BaseViewHolder>(R.layout.item_pl) {
    override fun convert(holder: BaseViewHolder, item: Pinglun) {
        holder.setText(R.id.pl_name,item.nickname)
        holder.setText(R.id.pl_time,item.createtime)
        holder.getView<RatingBar>(R.id.pl_rb).rating = item.score.toFloat()
        holder.setText(R.id.pl_comment,item.comment)
    }
}